export const formateDate = (date) => {
  if (!date) return "";
  const months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
  const timer = new Date(date);
  let year = timer.getFullYear();
  let monthIndex = timer.getMonth();// 获取月份索引（0-11）
  let mouth = months[monthIndex]; // 根据索引获取月份缩写 
  let day = (timer.getDate());
  let hour = (timer.getHours())
  hour = hour % 12 || 12; // 使用模运算符，如果为0则变为12 
  let houram = (hour > 12 ? 'p.m.ET ' : 'a.m.ET ')
  let min = timer.getMinutes().toString().padStart(2, '0');
  return `${mouth}.${day},${year}at  ${hour.toString().padStart(2, '0')}:${min} ${houram}`;
};

